package com.wang;

import com.wang.model.Counter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by wangixnyu on 2017/8/23.
 */
public class SpringTestMain {
    public static void main(String[] args) {
        //ApplicationContext ctx = new ClassPathXmlApplicationContext("spring/bean.xml");// 读取bean.xml中的内容
        ApplicationContext annotationContext = new AnnotationConfigApplicationContext("com.wang.config");
        Counter c = (Counter)annotationContext.getBean("counter");// 创建bean的引用对象
        System.out.println(c.getMultiplier());
        System.out.println(c.getSong());
    }
}
